/*
package com.itheima.web.config;

import com.itheima.web.interceptor.TokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Autowired
    private TokenInterceptor tokenInterceptor;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/html/**").addResourceLocations("classpath:/html/");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        List<String> urls = Stream.of(("/management/**"), ("/html/**"),("/system/users/verification"),("/system/users/login")).collect(Collectors.toList());
        registry.addInterceptor(tokenInterceptor).addPathPatterns("/**").excludePathPatterns(urls).excludePathPatterns("/");
    }
}
*/
